package com.xiaoran.RMQ_1.test8_over_channel;

import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.xiaoran.RMQ_1.utlis.RabbitMqUtils;

public class Over_channel_Producer {
    public static final String  normal_Exchange="normal_Exchange";
    public static final String  normal_queue="normal_queue";
   public static void main(String args[]) throws  Exception{
       Channel channel=RabbitMqUtils.getChannel();
       //设置我们的普通队列的消息过期时间  单位是毫秒
       /*AMQP.BasicProperties basicProperties=
               new AMQP.BasicProperties()
                       .builder()
                       .expiration("10000").build();
                       */
       //延迟消息
       for (int i=0;i<10;i++){
           String message="info"+i;
           channel.basicPublish(normal_Exchange,"zhangshan",null,message.getBytes());
       }
   }
}
